<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>delayDialog</title>
    <link rel="stylesheet" href="css/reset.css"/>
    <link rel="stylesheet" href="css/all.css"/>
    <script src="js/jquery-3.1.1.min.js"></script>
    <script src="js/self.js"></script>
</head>
<body ontouchstart="">

<!-- toast start -->
<div class="theme-popover-mask">

</div>
<div class="delayDialog w100 pf">
    <section class="jz of">
        <div class="dialogContent jz of cf tc f15">
            
        </div>
    </section>
</div>
<!-- toast end -->

<script>

    function dialogHide(dialog, mask) {
        var dialog = dialog;
        var mask = mask;
        console.log(mask);
        mask.fadeOut();
        dialog.slideUp();
    }

    function delayDialogShow(msg) {
        var dialog = $('.delayDialog');
        var mask = $('.theme-popover-mask');
        var btn = $('.close-btn');
        var content = $('.dialogContent');

        mask.fadeIn();
        dialog.slideDown();
        content.text(msg);

        setTimeout(function () {//关键的setTimeout
            mask.hide();
            dialog.hide();
        }, 2000);//等待3秒执行
    }

</script>

</body>
</html>